package ${controllerPackage};

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
<#if restControllerStyle>
import org.springframework.web.bind.annotation.RestController;
<#else>
import org.springframework.stereotype.Controller;
</#if>
<#if swagger>
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
</#if>
<#if superControllerClassPackage??>
import ${superControllerClassPackage};
</#if>
import com.baomidou.mybatisplus.core.metadata.IPage;
import ${package.Parent}.api.${entity}Api;
import ${package.Entity}.${entity};
import ${package.Entity}.${entity}Entity;
import com.web.common.result.R;
import ${servicePackage}.impl.${table.serviceName}Impl;

/**
 * <p>
 * ${table.comment!} 前端控制器
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
<#if swagger>
@Tag(name = "${table.comment!}")
</#if>
<#if restControllerStyle>
@RestController
<#else>
@Controller
</#if>
@RequestMapping("<#if package.ModuleName?? && package.ModuleName != "">/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
<#if kotlin>
class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
<#else>
<#if superControllerClass??>
public class ${table.controllerName} extends ${superControllerClass} {
<#else>
public class ${table.controllerName} implements ${entity}Api {
</#if>
	
	@Autowired
	private ${table.serviceName}Impl ${table.serviceName?uncap_first}Impl;

	<#if swagger>
	@Operation(summary = "获取查询数据列表")
	</#if>
	@Override
	public R<IPage<${entity}Entity>> getList(${entity}Entity condition) {
		return ${table.serviceName?uncap_first}Impl.getList(condition);
	}
	
	<#if swagger>
	@Operation(summary = "保存数据信息")
	</#if>
	@Override
	public R<Object> saveInfo(${entity} ${entity?uncap_first}) {
		return ${table.serviceName?uncap_first}Impl.saveInfo(${entity?uncap_first});
	}
	
	<#if swagger>
	@Operation(summary = "更新数据信息")
	</#if>
	@Override
	public R<Object> updateInfo(${entity} ${entity?uncap_first}) {
		return ${table.serviceName?uncap_first}Impl.updateInfo(${entity?uncap_first});
	}
	
	<#if swagger>
	@Operation(summary = "删除数据信息")
	</#if>
	@Override
	public R<Object> deleteInfo(${entity} ${entity?uncap_first}) {
		return ${table.serviceName?uncap_first}Impl.deleteInfo(${entity?uncap_first});
	}
}
</#if>
